if(!jsx3.lang.Class.forName("ux.cdb.admin.customer.cusBuilder.CareerInfo")) {
	jsx3.lang.Class.defineClass("ux.cdb.admin.customer.cusBuilder.CareerInfo",
			ux.megatron.gui.WizardPanel,
			null,
			function (block) {
				/**
				 * instance initializer
				 * @param strName {String} unique name distinguishing this object from all other JSX GUI objects in the JSX application
				 * @param vntLeft {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
				 * @param vntTop {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
				 * @param vntWidth {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
				 * @param vntHeight {int|String} either a number (i.e, 12, 30, etc) or a number and a unit value (i.e., "25%", "36pt", etc); if a number is passed, pixels will be the assumed unit when painted to screen
				 * @param strHTML {String} Text/HTML markup to place in the jsx3.gui.Block instance
				 */
				block.prototype.init = function(strName, vntLeft, vntTop, vntWidth, vntHeight, strHTML) {
					//call constructor for super class (the super expects the name of the object and the function that it is an instance of)
					this.jsxsuper(strName, vntLeft, vntTop, vntWidth, vntHeight, strHTML);
				};

				block.prototype.initialize = function(msg) {
					this.loaded = true;
					this.builder = this.getAncestorOfType("ux.cdb.admin.customer.cusBuilder.Builder");
					this.wizard = this.getAncestorOfType("ux.megatron.gui.SteppedWizard");
					
					var me = this;
					this.cacheLoaded();
					
					if(this.builder.editMode == "edit") {
						//console.log('this.builder.careerInfo : ', this.builder.careerInfo);
						this.getDescendantsOfType("ux.cdb.admin.dataautomate.GenericDetail")[0].setDataByObject(this.builder.careerInfo);
					}
				}
				
				block.prototype.cacheLoaded = function(objEvent) {
					var _cache = ux.cdb.admin.CommonCache.getInstance();
					var blkOrgProperty = this.get("blkOrgProperty").getChild(1);
					var blkAnnualIncome = this.get("blkAnnualIncome").getChild(1);
					blkOrgProperty.setSourceXML(_cache.getCache("CommonCache_ORG_PROPERTY"));
					//blkAnnualIncome.setSourceXML(_cache.getCache("CommonCache_ANNUAL_INCOME"));
					setTimeout(function(){
						blkOrgProperty.repaint();
						//blkAnnualIncome.repaint();
					},50);
				}

				block.prototype.onNext = function(objWIZARD, objBUTTON, objEVENT, strCURRENTPANEL) {
					return null; // return "NONE" to not next panels
				}

				block.prototype.onPrev = function(objWIZARD, objBUTTON, objEVENT, strCURRENTPANEL) {
					return null; // return "NONE" to not advance panels
				}

				block.prototype.onRevert = function(objWIZARD, objBUTTON, objEVENT, strCURRENTPANEL) {
					return null; // return "NONE" to not last status
				}

				block.prototype.onCancel = function(objWIZARD, objBUTTON, objEVENT, strCURRENTPANEL) {
					this.builder.onClose();
					return null;
				}
				block.prototype.onFinish = function(objWIZARD, objBUTTON, objEVENT, strCURRENTPANEL){
					if(!this._doValidate()) return 'NONE';
					//function to split area code 
					var rearrange = function(str,attArr){
						var obj = {};
						var arr = str.split(',');
						for(var i=0;i<arr.length;i++){
							obj[attArr[i]] = arr[i]; 
						}
						return obj;
					}
					var extendObj = function(tarObj,orgObj){
						for(var prop in orgObj){
							tarObj[prop] = orgObj[prop];
						}
						return tarObj;
					}
					
					//populate data
					var dataObj =  this.getDescendantsOfType("ux.cdb.admin.dataautomate.GenericDetail")[0].getDataAsObject();

					// save all the student info
					extendObj(this.builder.careerInfo,dataObj);
					this.builder.saveBuilder();
					
					return null; // return "NONE" to not advance panels
				}

				block.prototype.onCustomNav = function(objWIZARD, objBUTTON, objEVENT, strCURRENTPANEL) {
					return null; // return "NONE" to not advance panels
				}

				block.prototype.onBeforeShow = function(objWIZARD, objBUTTON, objEVENT, strLASTPANEL) {
					if(!this.getChild(0)) {
						var me = this;
						ux.megatron.Main.loadUIResourceAsync(me, "ux.cdb.admin","ux/cdb/admin/customer/cusBuilder/step4/ui/careerInfoContent.xml", me, me.initialize);
					}
					return null; // return "NONE" to not advance panels
				}

				block.prototype.onAfterHide = function(objWIZARD, objBUTTON, objEVENT, strNEXTPANEL) {
					return null; // return "NONE" to not advance panels
				}
				
				block.prototype.onStepJump =  function(objWIZARD,objSTEP,objEVENT,strCURRENTPANEL){
					return this.doValidation() ? null : 'NONE';
				};
				
				block.prototype._doValidate = function() {
                    this.detail = this.get("blkStep4");
					var errorMsgs = this.detail.doValidate();
                    this._message = errorMsgs === null ? null : (errorMsgs[0].label ? errorMsgs[0].label + " : " +errorMsgs[0].message : errorMsgs[0].message);
                    if(this._message === null) {
	    				return this.displayTip(true);
                    } else {
                        return this.displayTip(false);
                    }
                };
				
				block.prototype.displayTip = function(passed) {
                    if(!passed) {
                        var tip = ux.megatron.Main.getServer().getDynamicProperty("@cdb@cusbuilder@TipUnFinishedStep4");
                        this.wizard.getMessageLabel().setText(this._message ? this._message : tip);
                    } else {
                        this.wizard.getMessageLabel().setText("");
                    }
                    return passed;
                };
		}
	);
}
